package inspection

//
//import (
//	cp "db2s/componentInit"
//	"db2s/global"
//	mq "db2s/topic-mq"
//)
//import "sync/atomic"
//
//func subTaskInit(plan2 *SchedulePlan2) {
//	var (
//		selectCount int64 = 0
//		insertCount int64 = 0
//		recordCount int64 = -1
//		taskStatus  int64 = 1
//		beginTime   int64 = 0
//		errinfoInit atomic.Value
//		tableObject string
//		indexObject string
//		c           = global.GetIoc().GetBean("globalConfig").(*GlobalParametersConfig)
//	)
//	errinfoInit.Store("")
//	switch plan2.sync.PartitionData.SourceTablePartitionType {
//	case "partition":
//		tableObject = "P"
//	case "single":
//		tableObject = "N"
//	}
//	switch len(plan2.indexColumn) {
//	case 0:
//		indexObject = "M"
//	default:
//		indexObject = "I"
//	}
//	plan2.subTaskInfo = &mq.SubTasks{
//		Schema:      plan2.schema,
//		Table:       plan2.table,
//		Loc:         plan2.TableLocNumber,
//		SAccumulate: &selectCount,
//		RecordCount: &recordCount,
//		DAccumulate: &insertCount,
//		TaskStatus:  &taskStatus,
//		ErrorInfo:   errinfoInit,
//		BeginTime:   &beginTime,
//		TableObject: tableObject,
//		IndexObject: indexObject,
//		TopicCount: func() (tc map[string]*int64) {
//			tc = make(map[string]*int64)
//			for _, v1 := range GetCheckToTopicMQListeners()[cp.CheckMode(c.rules.CheckMode)] {
//				var ff int64 = 0
//				tc[string(v1.TopicName)] = &ff
//			}
//			return
//		}(),
//	}
//	PlanContext.TaskBarSubsStatusSend(plan2.subTaskInfo)
//}
//
//func (context *SchedulePlanContext) SubTaskBarAccumulate(n any) {
//	context.TaskBarTable.BarAccumulate(n)
//}
//func (context *SchedulePlanContext) taskBarEndTopicAdd(n any) {
//	context.TaskBarTable.TopicBarAdd(n)
//}
//func (context *SchedulePlanContext) TaskBarEndTopicDel(n any) {
//	context.TaskBarTable.TopicBarDel(n)
//}
//func (context *SchedulePlanContext) TaskBarSubsStatusSend(table *mq.SubTasks) {
//	context.TaskBarTable.BarSubsStatusSwapSend(table)
//}
//func (context *SchedulePlanContext) TaskBarSubsStatusSwap(table *mq.SubTasks, r string) {
//	context.TaskBarTable.BarSubsStatusSwap(table, r)
//}
//
////	func (context *SchedulePlanContext) TaskBarSubsXlsDataOutput(table *mq.SubTasks, r any) {
////		context.TaskBarTable.BarSubsXlsDataOutput(table, r)
////	}
//func (context *SchedulePlanContext) TaskBarSubsErrorSwap(table *mq.SubTasks, r string) {
//	context.TaskBarTable.BarSubsErrorSwap(table, r)
//}
//func (context *SchedulePlanContext) TaskBarSubsStatusGet(table *mq.SubTasks) int64 {
//	return context.TaskBarTable.BarSubsStatusGet(table)
//}
//
////	func (context *SchedulePlanContext) TaskBarDelete(n any) {
////		context.TaskBarTable.DelBar(n)
////	}
//func (context *SchedulePlanContext) TpodTableStatusSwap(status *int64, r string) {
//	switch r {
//	case "error":
//		atomic.SwapInt64(status, -1)
//	case "abnormal":
//		atomic.SwapInt64(status, -2)
//	case "finish":
//		atomic.SwapInt64(status, 0)
//	}
//}
